
#include "gtest/gtest.h"

#include "AdjacencyWDigraph.h"

TEST( AdjacencyWDigraphTest, Simple )
{
    AdjacencyWDigraph<int> G( 4,100 );

    EXPECT_EQ( 0, G.Edges() );
    EXPECT_EQ( 4, G.Vertices() );

    G.Add(2,4,1).Add(1,3,2).Add(2,1,3).Add(1,4,4).Add(4,2,5);
    EXPECT_EQ( 5, G.Edges() );

    G.Delete( 2, 1 );
    EXPECT_EQ( 4, G.Edges() );
    EXPECT_TRUE( G.Exist( 1, 3 ) );
    EXPECT_FALSE( G.Exist( 3, 1 ) );
    EXPECT_EQ( 1, G.InDegree(3) );
    EXPECT_EQ( 2, G.OutDegree(1) );

}

#include "main_stub.h"

